package group2assignone.ucm.manager;

import group2assignone.model.Flight;
import group2assignone.ucm.UCController;
import group2assignone.view.manager.CreateFlightView;

/**
 * Use Case: Create Flight Edit                                         <br>
 * Pre-Condition: Manager selects 'Edit'   from the create flight view  <br>
 * Post-Condition: UI is updated                                        <br>
 * 1. System clears current screen.                                     <br>
 * 2. System sets up the edit flight view with current flight details.  <br>
 *
 * @author group2
 */
public class UCCreateFlightEdit implements UCController {

    private CreateFlightView flightView = new CreateFlightView();
    private Flight f = new Flight();

    /**
     * sets view and flight
     * @param fView
     * @param flight
     */
    public UCCreateFlightEdit(CreateFlightView fView, Flight flight) {
        flightView = fView;
        f = flight;
    }
    /**
     * Use Case to allow the manager to edit flight details of a flight that is
     * being created.
     */
    @Override
    public void run() {
        //1. System clears current screen.
        flightView.clearScreen();
        //2. System sets up the edit flight view with current flight details.
        flightView.go();
        flightView.setText(f);
    }
}
